#!/usr/bin/python3
s = input("请输入字符串")
x = 0
for ch in s:
    if ch==' ':
        x +=1
print("字符串中有%d个空格"%x)
